/**
 @Name: 用户模块
 */

layui.define(['laypage', 'fly', 'element', 'flow'], function (exports) {

    var $ = layui.jquery;
    var layer = layui.layer;
    var util = layui.util;
    var laytpl = layui.laytpl;
    var form = layui.form;
    var laypage = layui.laypage;
    var fly = layui.fly;
    var flow = layui.flow;
    var element = layui.element;
    var upload = layui.upload;


    $(document).ready(function () {

        //同步获取 用户 信息
        lucode.getUserInfoSyn(function (userInfo) {
            // 获取 用户的 众筹记录  和 发起的众筹
            lucode.lucodeGet(lucode.serverURL + "/cmsCash/getOneUserCmsCash/" + userInfo.userId,
                null, null,
                function (data) {
                     //console.log(data);
                    // 获取整个 模板引擎
                    var userTpl = document.getElementById("userInfo").innerHTML,
                        // 获取 渲染后的视图 存放位置
                        view = document.getElementById('view');

                    laytpl(userTpl).render(data, function (html) {
                        // 渲染视图
                        view.innerHTML = html;

                    });


                });
        });



    });

    exports('user', null);


});